---
title: CodeMaps
summary: API reference for CodeMaps.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: package
---

# CodeMaps

`CodeMaps` is a `Public` partial class factory that hands callers a process-cached instance of `clsBenefitJurisdictionCodeMap` or `clsManualClassTypeCodeMap`, avoiding a repeated round trip to `BENEFIT_JURISDICTION_CODE`/`MANUAL_CLASS_TYPE_CODE` on every lookup while still allowing an explicit cache refresh ([BR-POL-016](../../business-rules.md#br-pol-016-code-map-caching)).

## Purpose
- Provide a single entry point per code map that returns a cached instance, built once per process and reused until `refresh:=True` is passed (BR-POL-016).
- Hide the `Friend` constructors of `clsBenefitJurisdictionCodeMap`/`clsManualClassTypeCodeMap` behind a public factory method.

## Context
- Namespace: `SAIF.Business.Policy`
- Assembly/package: `SAIF.Business.Policy` (`PolicyCommon`)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `GetBenefitJurisdictionCodeMap(inDPI, refresh)` | `Shared Function GetBenefitJurisdictionCodeMap(inDPI As IDataPortalInfo, Optional refresh As Boolean = False) As clsBenefitJurisdictionCodeMap` | Returns the cached benefit-jurisdiction code map, rebuilding it only if `refresh` is `True` or no cached instance exists yet (BR-POL-016, OP-12). |
| `GetManualClassTypeCodeMap(inDPI, refresh)` | `Shared Function GetManualClassTypeCodeMap(inDPI As IDataPortalInfo, Optional refresh As Boolean = False) As clsManualClassTypeCodeMap` | Returns the cached manual-class-type code map, rebuilding it only if `refresh` is `True` or no cached instance exists yet (BR-POL-016, OP-13). |

## Behavioral notes
- Caching is implemented with `Static` fields inside each factory method (declared across the two partial-class files), so cache scope is per app-domain, not per request or per `IDataPortalInfo` instance (BR-POL-016).
- Because the cache is keyed only by the presence of a prior instance (not by `inDPI`), the first caller's `IDataPortalInfo` effectively determines the connection context used for the cached data for the life of the process.*

## Constraints and usage notes
- Callers needing fresh code-table data after an underlying table change must explicitly pass `refresh:=True`; there is no time-based or event-based cache invalidation.

> **Note:** Statements marked with * were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Sources
- SAIF.Business.Policy/CodeMaps/clsBenefitJurisdictionCodeMap.vb
- SAIF.Business.Policy/CodeMaps/clsManualClassTypeCodeMap.vb
